﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="profile.aspx.cs" Inherits="account_profile" %>

<%@ Register TagPrefix="artisteer" Namespace="Artisteer" %>
<%@ Register TagPrefix="art" TagName="DefaultSidebar1" Src="~/DefaultSidebar1.ascx" %>
<asp:Content ID="SideBar1" ContentPlaceHolderID="Sidebar1ContentPlaceHolder" runat="Server">
    <art:DefaultSidebar1 ID="DefaultSidebar1Content" runat="server" /></asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="SheetHeaderPlaceHolder" runat="Server">Profile</asp:Content>
<asp:Content ID="SheetContent" ContentPlaceHolderID="SheetContentPlaceHolder" runat="Server">
            <table width="600">
                <tr>
                    <td>
                        <asp:Panel ID="Panel1" runat="server" GroupingText="Personal">
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_FirstName" runat="server" AssociatedControlID="txt_FirstName">First Name</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_FirstName" runat="Server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_LastName" runat="server" AssociatedControlID="txt_LastName">Last Name</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_LastName" runat="Server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_Phone" runat="server" AssociatedControlID="txt_Phone">Phone</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_Phone" runat="Server" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                    <td>
                        <asp:Panel ID="Panel2" runat="server" GroupingText="Address">
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_City" runat="server" AssociatedControlID="drpList_City">City</asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="drpList_City" runat="Server" DataSourceID="citydatasource"
                                            DataTextField="Name" DataValueField="CityID" AutoPostBack="True" />
                                        <asp:SqlDataSource ID="citydatasource" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>"
                                            SelectCommand="SELECT * FROM [City]"></asp:SqlDataSource>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_Town" runat="server" AssociatedControlID="drpList_City">Town</asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="drpList_Town" runat="Server" DataSourceID="towndatasource"
                                            DataTextField="Name" DataValueField="TownID" />
                                        <asp:SqlDataSource ID="towndatasource" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>"
                                            SelectCommand="SELECT * FROM [Town] WHERE ([CityID] = @CityID)">
                                            <SelectParameters>
                                                <asp:ControlParameter ControlID="drpList_City" Name="CityID" PropertyName="SelectedValue"
                                                    Type="Int32"/>
                                            </SelectParameters>
                                        </asp:SqlDataSource>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_vicinity" runat="server" AssociatedControlID="txt_vicinity">Vicinity</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_vicinity" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                 <tr>
                                    <td>
                                        <asp:Label ID="lbl_street" runat="server" AssociatedControlID="txt_street">Street</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_street" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbl_no" runat="server" AssociatedControlID="txt_no">No</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txt_no" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                    <td>
                        <asp:ImageButton ID="ImageButton1" runat="server" Height="80px" ImageUrl="~/images/noavatar.jpg"
                            Width="80px" />
                        <br />
                        <asp:LinkButton ID="LinkButton1" runat="server">Change Picture</asp:LinkButton>
                        <br />
                        <asp:LinkButton ID="LinkButton2" runat="server">Delete Picture</asp:LinkButton>
                    </td>
                </tr>
            </table>
            <b>Name:</b>
            <%= Profile.FirstName %>
            <%= Profile.LastName %><br />
            <b>User Name:</b>
            <%= Page.User.Identity.Name %><br />
            <b>Membership:</b>
            <% if(Page.User.IsInRole("Admin")){%>Administrator
            <% }
               else if (Page.User.IsInRole("Driver"))
               {%>Driver
            <% }
               else
               {%>Customer<%} %>
            <hr />
            <asp:Button ID="Button1" Text="Update Profile" OnClick="UpdateProfile" runat="server" />
</asp:Content>
